@use '../../../../scss/utils.scss';
@use '../../../../scss/variables.scss';

.toc-wrapper {
  width: 250px;
  padding-left: 45px;
  box-sizing: border-box;
  position: fixed;
  top: 90px;
  right: 20px;
  max-height: 350px;
  max-height: calc(100vh - 350px);

  @media print {
    display: none;
  }

  ul {
    position: relative;
    padding: 0;

    &::before {
      content: '';
      position: absolute;
      left: 0;
      top: 10px;
      bottom: 10px;
      width: 2px;
      background: var(--background-4dp);
    }
  }

  li {
    display: block;
    position: relative;
    padding-left: 30px;
    font-size: 14px;
    line-height: 24px;
    margin-bottom: 6px;

    &:hover {
      color: variables.$red-color;
      @include utils.text-gradient();
    }
  }

  .current {
    color: variables.$red-color;
    @include utils.text-gradient();
    font-weight: 600;

    &::before {
      background: variables.$red-gradient;
      border-color: variables.$red-gradient;
      border-width: 1px;
      left: -3px;
    }
  }

  li {
    &::before {
      @include utils.radius(50%);
      @include utils.transform(translateY(-50%));

      content: '';
      background: var(--background);
      border: 2px solid var(--background-4dp);
      left: -4px;
      width: 6px;
      height: 6px;
      top: 50%;
      display: inline-block;
      position: absolute;
    }

    &:last-of-type::before {
      top: auto;
      bottom: 0;
    }
  }

  a {
    color: var(--color);
    font-weight: normal;
    &:hover {
      color: variables.$red-color; 
      @include utils.text-gradient();
    }
  }

  .current a {
    font-weight: 600;
    color: variables.$red-color;
    @include utils.text-gradient();
  }
}
